Postgres pg_dump 顯示空文件 (Postgres pg_dump show empty file)


問題描述

Postgres pg_dump 顯示空文件 (Postgres pg_dump show empty file)

我在 wamp 中使用此命令,但我得到空的 Mybackup.sql 文件,我知道我缺少什麼嗎?

<?php    exec("pg_dump ‑U postgres taro‑api > Mybackup.sql"); ?>

參考解法

方法 1:

With the additional information from the comments, it becomes clear that you are on Windows and pg_dump is not on your PATH.

Either use the full absolute path for pg_dump or add the directory to the PATH environment variable.

(by Kamran SohailLaurenz Albe)

參考文件

  1. Postgres pg_dump show empty file (CC BY‑SA 2.5/3.0/4.0)

#pg-dump #PHP #postgresql






相關問題

如何檢查我是否只刪除了所需的數據? (How do I check that I removed required data only?)

無法恢復 pg_dump 備份 (Unable to restore pg_dump backup)

使用帶有 Curl 的緩衝輸出將文件上傳到 ftp 服務器 (Upload a file into a ftp server using buffered output with Curl)

帶有 -C 選項的 pg_restore 不會創建數據庫 (pg_restore with -C option does not create the database)

pg_dump 數據庫轉儲是“當時”轉儲嗎? (Is a pg_dump DB dump 'at-that-time' dump?)

PSQL 數據庫傳輸和錯誤 (PSQL database transfer and errors)

Postgres pg_dump 顯示空文件 (Postgres pg_dump show empty file)

將 pg_restore 與多個轉儲一起使用時管理外鍵 (Managing foreign keys when using pg_restore with multiple dumps)

設計:在不斷創建和刪除表時運行 pg_dump (Design: running pg_dump when tables are continuously created and dropped)

轉儲文件中視圖預定義的目的是什麼 (What is the purpose of views' predefinitions in dump file)

如何附加 pg_dump 備份命令 PostgreSQL 的日誌輸出 (How to append log output of pg_dump backup command PostgreSQL)

PostgreSQL:單個表的 pg_dump (PostgreSQL: pg_dump for a single table)







留言討論